package com.oxygenecore.processor.tool;

import com.oxygenecore.processor.statement.ForLoopStatement;

import java.lang.reflect.Constructor;
import java.lang.reflect.Type;

/**
 * @author Askar Kalykov
 *         Date: 27.09.2010
 *         Time: 12:58:09
 */
public class Test {
    public static void main(String[] args) {
        Constructor<?> constructor = ForLoopStatement.class.getConstructors()[0];
        Type[] types = constructor.getGenericParameterTypes();
        for (Type type : types) {
            checkType(type);
        }
    }
    
    private static void checkType(Type type){
        System.out.println("Type: " + type);
        ParameterParser parser = new ParameterParser();
        try {
            parser.parseClass(type);
            System.out.println("parseClass");
        } catch (Exception e) {
        }
        try {
            parser.parseStatement(type);
            System.out.println("parseStatement");
        } catch (Exception e) {
        }
        try {
            parser.parseLeafExpression(type);
            System.out.println("parseLeafExpression");
        } catch (Exception e) {
        }
        try {
            parser.parseTypedLeafExpression(type);
            System.out.println("parseTypedLeafExpression");
        } catch (Exception e) {
        }
        try {
            parser.parseGenericLeafExpression(type);
            System.out.println("parseGenericLeafExpression");
        } catch (Exception e) {
        }
        try {
            parser.parseExpression(type);
            System.out.println("parseExpression");
        } catch (Exception e) {
        }
        try {
            parser.parseTypedExpression(type);
            System.out.println("parseTypedExpression");
        } catch (Exception e) {
        }
        try {
            parser.parseGenericExpression(type);
            System.out.println("parseGenericExpression");
        } catch (Exception e) {
        }
        try {
            parser.parseStatementList(type);
            System.out.println("parseStatementList");
        } catch (Exception e) {
        }
        try {
            parser.parseLeafExpressionList(type);
            System.out.println("parseLeafExpressionList");
        } catch (Exception e) {
        }
        try {
            parser.parseTypedLeafExpressionList(type);
            System.out.println("parseTypedLeafExpressionList");
        } catch (Exception e) {
        }
        try {
            parser.parseGenericLeafExpressionList(type);
            System.out.println("parseGenericLeafExpressionList");
        } catch (Exception e) {
        }
        try {
            parser.parseExpressionList(type);
            System.out.println("parseExpressionList");
        } catch (Exception e) {
        }
        try {
            parser.parseTypedExpressionList(type);
            System.out.println("parseTypedExpressionList");
        } catch (Exception e) {
        }
        try {
            parser.parseGenericExpressionList(type);
            System.out.println("parseGenericExpressionList");
        } catch (Exception e) {
        }

    }
}
